class PersonalModel {
  int? userState;
  int? muteStatus;
  PersonalGuard? guard;
  int? isAnchor;
  PersonalAnchor? anchor;
  PersonalOnline? online;
  List<String>? album;
  PersonalInfo? info;
  List<PersonalSkill>? skill;
  List<String>? dynamicImgs;
  List<PersonalGifts>? gifts;
  List<PersonalLabel>? label;
  List<PersonalLabel>? labelList;
  String? goodRate;
  String? intimateTitle;
  int? intimateLevel;
  int? intimateDegree;
  int? historyDegree;

  PersonalModel(
      {userState,
      muteStatus,
      guard,
      isAnchor,
      anchor,
      online,
      album,
      info,
      skill,
      dynamic,
      gifts,
      label,
      labelList,
      goodRate,
      intimateTitle,
      intimateLevel,
      intimateDegree,
      historyDegree});

  PersonalModel.fromJson(Map<String, dynamic> json) {
    userState = json['user_state'];
    muteStatus = json['mute_status'];
    guard =
        json['guard'] != null ? PersonalGuard.fromJson(json['guard']) : null;
    isAnchor = json['is_anchor'];
    anchor =
        json['anchor'] != null ? PersonalAnchor.fromJson(json['anchor']) : null;
    online =
        json['online'] != null ? PersonalOnline.fromJson(json['online']) : null;
    album = json['album'].cast<String>();
    info = json['info'] != null ? PersonalInfo.fromJson(json['info']) : null;
    if (json['skill'] != null) {
      skill = <PersonalSkill>[];
      json['skill'].forEach((v) {
        skill!.add(PersonalSkill.fromJson(v));
      });
    }
    dynamicImgs = json['dynamic'].cast<String>();
    if (json['gifts'] != null) {
      gifts = <PersonalGifts>[];
      json['gifts'].forEach((v) {
        gifts!.add(PersonalGifts.fromJson(v));
      });
    }
    if (json['label'] != null) {
      label = <PersonalLabel>[];
      json['label'].forEach((v) {
        label!.add(PersonalLabel.fromJson(v));
      });
    }
    if (json['label_list'] != null) {
      labelList = <PersonalLabel>[];
      json['label_list'].forEach((v) {
        labelList!.add(PersonalLabel.fromJson(v));
      });
    }
    goodRate = json['good_rate'];
    intimateTitle = json['intimate_title'];
    intimateLevel = json['intimate_level'] ?? 0;
    intimateDegree = json['intimate_degree'];
    historyDegree = json['history_degree'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['user_state'] = userState;
    data['mute_status'] = muteStatus;
    if (guard != null) {
      data['guard'] = guard!.toJson();
    }
    data['is_anchor'] = isAnchor;
    if (anchor != null) {
      data['anchor'] = anchor!.toJson();
    }
    if (online != null) {
      data['online'] = online!.toJson();
    }
    data['album'] = album;
    if (info != null) {
      data['info'] = info!.toJson();
    }
    if (skill != null) {
      data['skill'] = skill!.map((v) => v.toJson()).toList();
    }
    data['dynamicImgs'] = dynamic;
    if (gifts != null) {
      data['gifts'] = gifts!.map((v) => v.toJson()).toList();
    }
    if (label != null) {
      data['label'] = label!.map((v) => v.toJson()).toList();
    }
    if (labelList != null) {
      data['label_list'] = labelList!.map((v) => v.toJson()).toList();
    }
    data['good_rate'] = goodRate;
    data['intimate_title'] = intimateTitle;
    data['intimate_level'] = intimateLevel;
    data['intimate_degree'] = intimateDegree;
    data['history_degree'] = historyDegree;
    return data;
  }
}

class PersonalGuard {
  String? guardPrice;
  List<String>? list;
  int? diffNum;
  String? nickname;
  String? avatar;
  int? userId;
  int? intimateNum;
  int? guardSymbolTotal;
  int? guardPersonTotal;

  PersonalGuard(
      {guardPrice,
      list,
      diffNum,
      nickname,
      avatar,
      userId,
      intimateNum,
      guardSymbolTotal,
      guardPersonTotal});

  PersonalGuard.fromJson(Map<String, dynamic> json) {
    guardPrice = json['guard_price'].toString();
    if (json['list'] != null) {
      list = <String>[];
      json['list'].forEach((v) {
        list!.add(v);
      });
    }
    diffNum = json['diff_num'];
    nickname = json['nickname'];
    avatar = json['avatar'];
    userId = json['user_id'];
    intimateNum = json['intimate_num'];
    guardSymbolTotal = json['guard_symbol_total'];
    guardPersonTotal = json['guard_person_total'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['guard_price'] = guardPrice;
    if (list != null) {
      data['list'] = list;
    }
    data['diff_num'] = diffNum;
    data['nickname'] = nickname;
    data['avatar'] = avatar;
    data['user_id'] = userId;
    data['intimate_num'] = intimateNum;
    data['guard_symbol_total'] = guardSymbolTotal;
    data['guard_person_total'] = guardPersonTotal;
    return data;
  }
}

class PersonalAnchor {
  /// 视频开启状态: 0-勿扰 1-可拨打
  int? openVideoStatus;

  /// 是否隐藏接单次数: 1-隐藏 2-不隐藏
  int? orderSwitch;

  /// 检测用户之间是否能视频: 0-可视频 1-正在视频
  int? videoStatus;

  PersonalAnchor({openVideoStatus, orderSwitch, videoStatus});

  PersonalAnchor.fromJson(Map<String, dynamic> json) {
    openVideoStatus = json['open_video_status'];
    orderSwitch = json['order_switch'];
    videoStatus = json['video_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['open_video_status'] = openVideoStatus;
    data['order_switch'] = orderSwitch;
    data['video_status'] = videoStatus;
    return data;
  }
}

class PersonalOnline {
  int? status;
  String? statusMsg;
  int? onlineStatus;

  PersonalOnline({status, statusMsg, onlineStatus});

  PersonalOnline.fromJson(Map<String, dynamic> json) {
    status = json['status'];
    statusMsg = json['statusMsg'];
    onlineStatus = json['online_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['status'] = status;
    data['statusMsg'] = statusMsg;
    data['online_status'] = onlineStatus;
    return data;
  }
}

class PersonalInfo {
  int? userid;
  String? usercode;
  String? nickname;
  int? age;
  int? gender;
  String? avatar;
  String? tag;
  String? icon;
  String? city;
  int? loveValue;
  int? wealthValue;
  int? vip;
  int? vipLevel;
  int? inBlack;
  String? voice;
  int? voiceTime;
  int? fansCount;

  /// 是否关注: 0-未关注 1-已关注
  int? isFollow;
  int? isFollowBack;
  String? remarkName;

  PersonalInfo(
      {userid,
      usercode,
      nickname,
      age,
      gender,
      avatar,
      tag,
      icon,
      city,
      loveValue,
      wealthValue,
      vip,
      vipLevel,
      inBlack,
      voice,
      voiceTime,
      fansCount,
      isFollow,
      isFollowBack,
      remarkName});

  PersonalInfo.fromJson(Map<String, dynamic> json) {
    userid = json['userid'];
    usercode = json['usercode'];
    nickname = json['nickname'];
    age = json['age'];
    gender = json['gender'];
    avatar = json['avatar'];
    tag = json['tag'];
    icon = json['icon'];
    city = json['city'];
    loveValue = json['love_value'];
    wealthValue = json['wealth_value'];
    vip = json['vip'];
    vipLevel = json['vip_level'];
    inBlack = json['in_black'];
    voice = json['voice'];
    voiceTime = json['voice_time'];
    fansCount = json['fans_count'];
    isFollow = json['is_follow'];
    isFollowBack = json['is_follow_back'];
    remarkName = json['remark_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['userid'] = userid;
    data['usercode'] = usercode;
    data['nickname'] = nickname;
    data['age'] = age;
    data['gender'] = gender;
    data['avatar'] = avatar;
    data['tag'] = tag;
    data['icon'] = icon;
    data['city'] = city;
    data['love_value'] = loveValue;
    data['wealth_value'] = wealthValue;
    data['vip'] = vip;
    data['vip_level'] = vipLevel;
    data['in_black'] = inBlack;
    data['voice'] = voice;
    data['voice_time'] = voiceTime;
    data['fans_count'] = fansCount;
    data['is_follow'] = isFollow;
    data['is_follow_back'] = isFollowBack;
    data['remark_name'] = remarkName;
    return data;
  }
}

class PersonalSkill {
  int? id;
  String? name;
  String? icon;
  int? price;
  String? vipPrice;
  String? svipPrice;
  int? score;
  String? unit;
  int? serviceCount;
  int? serviceTime;
  int? voicePrice;

  PersonalSkill(
      {id,
      name,
      icon,
      price,
      vipPrice,
      svipPrice,
      score,
      unit,
      serviceCount,
      serviceTime,
      voicePrice});

  PersonalSkill.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    icon = json['icon'];
    price = json['price'];
    vipPrice = json['vip_price'];
    svipPrice = json['svip_price'];
    score = json['score'];
    unit = json['unit'];
    serviceCount = json['service_count'];
    serviceTime = json['service_time'];
    voicePrice = json['voice_price'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['icon'] = icon;
    data['price'] = price;
    data['vip_price'] = vipPrice;
    data['svip_price'] = svipPrice;
    data['score'] = score;
    data['unit'] = unit;
    data['service_count'] = serviceCount;
    data['service_time'] = serviceTime;
    data['voice_price'] = voicePrice;
    return data;
  }
}

class PersonalGifts {
  int? id;
  String? name;
  String? img;
  int? price;
  String? total;

  PersonalGifts({id, name, img, price, total});

  PersonalGifts.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    img = json['img'];
    price = json['price'];
    total = json['total'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['img'] = img;
    data['price'] = price;
    data['total'] = total;
    return data;
  }
}

class PersonalLabel {
  String? label;
  int? total;

  PersonalLabel({label, total});

  PersonalLabel.fromJson(Map<String, dynamic> json) {
    label = json['label'];
    total = json['total'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['label'] = label;
    data['total'] = total;
    return data;
  }
}
